import request from '@/utils/request'

// 查询订单列表
export function sumData(query) {
  return request({
    url: '/taskhub/order/sum-data',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/taskhub/order/list',
    method: 'get',
    params: query
  })
}
// 查询订单详情
export function detailOrder(query) {
  return request({
    url: '/taskhub/order/detail',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/taskhub/order/' + id,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/taskhub/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/taskhub/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(id) {
  return request({
    url: '/taskhub/order/' + id,
    method: 'delete'
  })
}

// 接单
export function takeOrder(data) {
  return request({
    url: '/taskhub/order/take-order',
    method: 'put',
    data: data
  })
}

// 取件
export function pickUp(data) {
  return request({
    url: '/taskhub/order/pick-up',
    method: 'put',
    data: data
  })
}

// 送达
export function arrive(data) {
  return request({
    url: '/taskhub/order/arrive',
    method: 'put',
    data: data
  })
}
